IndexshtmlAction(); //调用执行
/*
*判断上个地址来源
*如果是其他网站跳转过来记录域名
*
*/
function IndexshtmlAction()
{
	var ParentURL=document.referrer;//上级来源地址
	var from = getUrl().from;
	if(from != undefined && from !='')
	{
		return false;
	}
	if (ParentURL==''|| ParentURL== undefined || ParentURL==null)	//手工输入
	{
		return false;
	}
	var domain = Obtain_realm(ParentURL);
	if(domain==false){
		return false;
	}
	//判段是否内部跳转
	if ( /masa/.test(domain)==true || /vivi/.test(domain)==true)
	{
		return false;
	}else{
		jQuery.get("/interface.php", { index_action: domain,time:Math.random()});
	}
}
//获取域名
function Obtain_realm(http_url){
   if(http_url==null){
	return false;
   }
   var matching = /^(http:\/\/)[a-z-A-Z-0-9]([^\/]+)/i;    // 创建正则表达式模式。
   var URL = http_url.match(matching);   // 尝试匹配搜索字符串。
   if(URL==null||URL[0]==undefined ||URL[0]==null){
	return false;
   }
   return URL[0];         //返回url地址
}

// 用来获得GET值
function getUrl(){
    var args = new Object( );
    var query = location.search.substring(1);     // Get query string
    var pairs = query.split("&");                 // Break at ampersand
    for(var i = 0; i < pairs.length; i++) {
        var pos = pairs[i].indexOf('=');          // Look for "name=value"
        if (pos == -1) continue;                  // If not found, skip
        var argname = pairs[i].substring(0,pos);  // Extract the name
        var value = pairs[i].substring(pos+1);    // Extract the value
        value = decodeURIComponent(value);        // Decode it, if needed
        args[argname] = value;                    // Store as a property
    }
    return args;                                  // Return the object
}